<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" href="css/bootstrap.min.css" />
<script type="text/javascript" src="js/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript">
	var  flag = false;
	$(function() {
		$("#pwd2").blur(function() {
			var p1 = document.getElementById("pwd1");
			var p2 = document.getElementById("pwd2");
			if (p1.value.length > 0 || p2.value.length > 0) {
				if (p1.value == p2.value) {
					document.getElementById("s").innerHTML = "密码一致";
					console.log("密码一致");
					flag = true;
				} else {
					document.getElementById("s").innerHTML = "两次密码不一致";
					console.log("两次密码不一致");
					flag = false;
				}
			} else {
				document.getElementById("s").innerHTML = "";

			}
		})
		
	})
	function myCheck() {
	 	return flag;
	}
</script>
<style type="text/css">
#top {
	height: 50px;
	width: 1200px;
	margin: 0 auto;
}

#center {
	height: 800px;
	width: 1200px;
	margin: 0 auto;
}

#footer {
	height: 50px;
	width: 1200px;
	margin: 0 auto;
}
#s{
	color:red;
}
</style>
</head>
<body>
	<div id="top">
		<jsp:include page="top.jsp"></jsp:include>
	</div>
	<div id="center">
		<div id="left">
			<table class="table">
				<tr>
					<td>照片</td>
					<td><img alt="tu" src="image/${emp.eimg }.jpg" style="width: 50px; height: 50px"></td>
				</tr>
				<tr>
					<td>姓名</td>
					<td>${emp.ename }</td>
				</tr>
				<tr>
					<td>密码</td>
					<td>${emp.epwd }</td>
				</tr>
				<tr>
					<td>所属科室</td>
					<td>${emp.dept.dename }</td>
				</tr>
				<tr>
					<td>等级</td>
					<td>${emp.elev }</td>
				</tr>
				<tr>
					<td>状态</td>
					<td>${emp.estate }</td>
				</tr>
			</table>
		</div>
		<div id="main"></div>
		<div id="right">
			<form class="form-horizontal" action="userUpdateByEid.do" onsubmit="return myCheck()"
				method="post">
				<div class="form-group">
					<label for="pwd1" class="col-sm-2 control-label">新密码:</label>
					<div class="col-sm-4">
						<input type="password" class="form-control" id="pwd1" name="upwd"
							placeholder="请输入新密码">
					</div>
				</div>
				<div class="form-group">
					<label for="pwd2" class="col-sm-2 control-label">确定新密码:</label>
					<div class="col-sm-4">
						<input type="password" class="form-control" id="pwd2" name="pwd"
							placeholder="确定新密码">
					</div>
					<div class="col-sm-4" id="s"></div>
				</div>
				<div class="form-group">
					<div class="col-sm-offset-2 col-sm-10">
						<input type="hidden" name="uname"
							value="<s:property value='user.uname'/>"> <input
							type="hidden" name="uid" value="<s:property value='user.uid'/>">
						<br>
						<button type="submit" class="btn btn-info">修改</button>
					</div>
				</div>
			</form>
		</div>

	</div>
	<div id="footer">
		<jsp:include page="footer.jsp"></jsp:include>
	</div>
</body>
</html>